﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.Customers>" %>


<%@ Import Namespace="CRM.Resourses" %>


<% Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdCreditContidions";
                                        settings.KeyFieldName = "IdCreditCondition";
                                        settings.CallbackRouteValues =
                                            new { Controller = "Contracts", Action = "CustomerCreditConditionsPartial", customerId = Model.IdCustomer };
                                        settings.SettingsPager.PageSize = 20;

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.LegalEntityName;
                                            column.FieldName = "LegalEntityName";


                                        });
                                        
                                        settings.Columns.Add(column =>
                                                                 {
                                                                     column.Caption = Resourses.CreditConditionType;
                                                                     column.FieldName = "CreditConditionType";
                                                                 });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.CreditConditionAmount;
                                            column.FieldName = "CreditConditionAmount";
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.Unit;
                                            column.FieldName = "Unit";
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.CalendarDaysQuantity;
                                            column.FieldName = "NumberOfDays";
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.StartDate;
                                             column.FieldName = "StartDate";
                                        });


                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.EndDate;
                                         column.FieldName = "EndDate";
                                        });


                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.Comments;
                                            column.FieldName = "Comments";
                                        });


                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.AdditionalContract;
                                             column.FieldName = "IdContract";
                                        });


                                    }).Bind(Model.CreditConditions).GetHtml();
                                    
                                    
                                    %>